﻿using HCQ2_IBLL;
using HCQ2_Model;
using HCQ2_Model.VLine.InputDto._0322;
using HCQ2_Model.VLine.OutputDto;
using HCQ2_Model.VR.Model;
using HCQ2_Model.VR.Params;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace HCQ2_BLL
{
    public partial class T_VRFounderApplyBLL: IT_VRFounderApplyBLL
    {
        /// <summary>
        ///  获取合伙人申请列表
        /// </summary>
        /// <param name="applyStatus">状态</param>
        /// <param name="page">第几页</param>
        /// <param name="rows">每页数</param>
        /// <param name="total">记录数</param>
        /// <returns></returns>
        public List<UserMessageResult> GetUserMessageList(int applyStatus, int page, int rows, out int total)
        {
            return DBSession.IT_VRFounderApplyDAL.GetUserMessageList(applyStatus, page, rows, out total);
        }

        //*******************************************接口************************************************
        /// <summary>
        ///  获取合伙人列表
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public List<PartnerOuput> GetPartnerList(PartnerInput param)
        {
            List<PartnerOuput> list = DBSession.IT_VRFounderApplyDAL.GetPartnerList(param);
            list.ForEach(o =>
            {
                if (!string.IsNullOrEmpty(o.user_img) && o.user_img.IndexOf("http")<0)
                    o.user_img = o.user_img.Replace("~", HttpContext.Current.Request.Url.AbsoluteUri.Substring(0, HttpContext.Current.Request.Url.AbsoluteUri.IndexOf("/api/")));
            });
            return list;
        }
        /// <summary>
        ///  获取下线用户列表
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public List<PartnerOuput> GetOffLineUserList(OffLineUserParam param)
        {
            List<PartnerOuput> list = DBSession.IT_VRFounderApplyDAL.GetOffLineUserList(param);
            list.ForEach(o =>
            {
                if (!string.IsNullOrEmpty(o.user_img) && o.user_img.IndexOf("http")<0)
                    o.user_img = o.user_img.Replace("~", HttpContext.Current.Request.Url.AbsoluteUri.Substring(0, HttpContext.Current.Request.Url.AbsoluteUri.IndexOf("/api/")));
            });
            return list;
        }
        /// <summary>
        ///  获取积分明细
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public List<ScoreDetialResult> GetScoreDetial(OffLineUserParam param)
        {
            return DBSession.IT_VRFounderApplyDAL.GetScoreDetial(param);
        }
    }
}